package com.hw.one.collect.fileupload.job;

import com.hw.one.collect.config.DropTimeConfig;
import com.hw.one.collect.fileupload.collect.ZipFileDataCollector;
import com.hw.one.transpot.fileupload.util.UploadUtil;
import com.hw.one.collect.job.Job;
import com.hw.one.collect.cache.CacheService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
 * @Class UploadJob
 * @Author guoshenzhen
 * @Date 2018/3/14  15:59
 */
@Component
public class CompressJob extends Job {
    private Logger log = LoggerFactory.getLogger(this.getClass());
    @Override
    public void start(){
        log.debug(this.getClass().getSimpleName() + ".start--->>>starting...");
        add();
        log.debug(this.getClass().getSimpleName() + ".start--->>>ended...");
    }

    public void add(){
        UploadUtil.compress();
        CacheService.add(new ZipFileDataCollector().collect(null));
    }



}
